package com.cloud.dubbo.consumer.controller;

import com.cloud.dubbo.api.service.HelloService;
import com.cloud.dubbo.consumer.service.ProductService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class ConsumerController {
    @DubboReference
    HelloService helloService;
    @Resource
    ProductService productService;

    @GetMapping("/")
    public String test() {
        return helloService.hello();
    }

    @GetMapping("/create")
    public String createOrder() {
        return productService.createOrder();
    }
}
